/**
 * @file: proc.h
 * @author: yumeng (imyumeng@qq.com)
 * @brief:
 * @version 0.1
 * @date: 2021-09-05
 *
 * @copyright Meng_Yu Copyright (c) 2021
 *
 * @history: init first version. 2021-09-05
 */
#ifndef _PROC_H_
#define _PROC_H_

#define INI_NAME "binupdate.ini"
#define INI_DEF_STR "a.bin"

#define INI_SEC_BIN 				"bin_cfg"
#define INI_SEC_SUB_BIN_PATH 		"bin_path"
#define INI_SEC_SUB_BIN_NUM_OFST	"bin_num_ofst"
#define INI_SEC_SUB_BIN_NUM 		"bin_num"

#define INI_SEC_SUB_ADDR_OFST 		"addr_ofst"
#define INI_SEC_SUB_ADDR 			"addr"
#define INI_SEC_SUB_LEN_OFST 		"len_ofst"
#define INI_SEC_SUB_LEN 			"len"

#define STR_LEN 128
#define BIN_NUM 8
#define PATH_LEN 512

typedef struct
{
	unsigned char ini_path_name[PATH_LEN];
	unsigned int bin_num;
	unsigned int bin_num_ofst;
	char bin_path[STR_LEN];
	unsigned int addr_ofst[BIN_NUM];
	unsigned int addr[BIN_NUM];
	unsigned int len_ofst[BIN_NUM];
	unsigned int len[BIN_NUM];
}proc_data_t;

extern proc_data_t g_data;
extern int Read_Tnifile(void);
extern int Write_Tnifile(void);
extern void path_proc(char *path);

#endif /* _PROC_H_ */
